package com.example.javaeekeshe.service.impl;

import com.example.javaeekeshe.mapper.GoodMapper;
import com.example.javaeekeshe.pojo.GoodsBean;
import com.example.javaeekeshe.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements IGoodsService {
    @Autowired
    GoodMapper mapper;

    public List<GoodsBean> selectAllGood(){
        return  mapper.selectAll();
    }

    public GoodsBean selectGoodById(Integer id){
        return mapper.selectById(id);
    }

    @Override
    public void seyState(Integer id, Integer state) {
        mapper.setSate(id,state);
    }

    @Override
    public void shelves(Integer id) {
        mapper.shelves(id);
    }

    @Override
    public void del(Integer id) {
        mapper.del(id);
    }

    public void update(GoodsBean goodsBean){
        mapper.update(goodsBean);
    }

    @Override
    public void addGoods(GoodsBean goodsBean) {
        mapper.addGoods(goodsBean);
    }

}
